.class Lcom/tendcloud/tenddata/dz$a;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;
.implements Ljava/lang/Runnable;


# instance fields
.field private volatile a:Z

.field private b:Z

.field private final c:Ljava/lang/ref/WeakReference;

.field private final d:Lcom/tendcloud/tenddata/ej;

.field private final e:Landroid/os/Handler;


# direct methods
.method constructor <init>(Landroid/view/View;Lcom/tendcloud/tenddata/ej;Landroid/os/Handler;)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p2, p0, Lcom/tendcloud/tenddata/dz$a;->d:Lcom/tendcloud/tenddata/ej;

    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/tendcloud/tenddata/dz$a;->c:Ljava/lang/ref/WeakReference;

    iput-object p3, p0, Lcom/tendcloud/tenddata/dz$a;->e:Landroid/os/Handler;

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/tendcloud/tenddata/dz$a;->b:Z

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/tendcloud/tenddata/dz$a;->a:Z

    invoke-virtual {p1}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v0

    invoke-virtual {v0}, Landroid/view/ViewTreeObserver;->isAlive()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-virtual {v0, p0}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V

    :cond_0
    invoke-virtual {p0}, Lcom/tendcloud/tenddata/dz$a;->run()V

    return-void
.end method

.method private b()V
    .locals 2

    iget-boolean v0, p0, Lcom/tendcloud/tenddata/dz$a;->b:Z

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/tendcloud/tenddata/dz$a;->c:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/View;

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v0

    invoke-virtual {v0}, Landroid/view/ViewTreeObserver;->isAlive()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-virtual {v0, p0}, Landroid/view/ViewTreeObserver;->removeGlobalOnLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V

    :cond_0
    iget-object v0, p0, Lcom/tendcloud/tenddata/dz$a;->d:Lcom/tendcloud/tenddata/ej;

    invoke-virtual {v0}, Lcom/tendcloud/tenddata/ej;->a()V

    :cond_1
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/tendcloud/tenddata/dz$a;->b:Z

    return-void
.end method


# virtual methods
.method a()V
    .locals 1

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/tendcloud/tenddata/dz$a;->a:Z

    iget-object v0, p0, Lcom/tendcloud/tenddata/dz$a;->e:Landroid/os/Handler;

    invoke-virtual {v0, p0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public onGlobalLayout()V
    .locals 0

    invoke-virtual {p0}, Lcom/tendcloud/tenddata/dz$a;->run()V

    return-void
.end method

.method public run()V
    .locals 2

    iget-boolean v0, p0, Lcom/tendcloud/tenddata/dz$a;->b:Z

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/tendcloud/tenddata/dz$a;->c:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/View;

    if-eqz v0, :cond_1

    iget-boolean v1, p0, Lcom/tendcloud/tenddata/dz$a;->a:Z

    if-eqz v1, :cond_2

    :cond_1
    invoke-direct {p0}, Lcom/tendcloud/tenddata/dz$a;->b()V

    goto :goto_0

    :cond_2
    iget-object v1, p0, Lcom/tendcloud/tenddata/dz$a;->d:Lcom/tendcloud/tenddata/ej;

    invoke-virtual {v1, v0}, Lcom/tendcloud/tenddata/ej;->a(Landroid/view/View;)V

    iget-object v0, p0, Lcom/tendcloud/tenddata/dz$a;->e:Landroid/os/Handler;

    invoke-virtual {v0, p0}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    goto :goto_0
.end method
